<template>
  <headVue name="修改信息"></headVue>
  <main>
    <van-form @submit="onSubmit">
      <van-cell-group inset>
        <van-field
          v-model="username"
          name="用户名"
          label="用户名"
          placeholder="用户名"
          :rules="[{ required: true, message: '请填写用户名' }]"
        />
        <van-field
          v-model="reallyUserName"
          name="姓名"
          label="姓名"
          placeholder="姓名"
          :rules="[{ required: true, message: '请填写姓名' }]"
        />
        <van-field
          v-model="password"
          type="password"
          name="密码"
          label="密码"
          placeholder="密码"
          :rules="[{ required: true, message: '请填写密码' }]"
        />
        <van-field name="uploader" label="文件上传">
          <template #input>
            <van-uploader v-model="value" />
          </template>
        </van-field>
      </van-cell-group>
      <div style="margin: 16px">
        <van-button round block type="primary" native-type="submit">
          提交
        </van-button>
      </div>
    </van-form>
  </main>
</template>

<script>
import headVue from "@/components/head.vue";
export default {
  name: "categoryPro",
  data() {
    return {
      username: "",
      password: "",
      reallyUserName: "",
      value:[{ url: 'https://img01.yzcdn.cn/vant/leaf.jpg' }]
    };
  },
  components: {
    headVue,
  },
  methods: {
    onSubmit(val) {
      console.log("val: ", val);
    },
  },
};
</script>

<style scoped>
:deep(.van-button--primary) {
  background-color: #1a9956;
}
</style>